{% extends "devhub/base.html" %}

{% block title %}
{{ dev_page_title(_('Recent Activity for My Add-ons')) }}
{% endblock %}

{% block rss_feed %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ rss }}">
{% endblock %}

{% block content %}
<header>
  {% if addon %}
    {# L10n: first parameter is the name of an Addon #}
    <h2>{{ _('Recent Activity for {0}')|format_html(addon.name) }}</h2>
  {% else %}
    <h2>{{ _('Recent Activity for My Add-ons') }}</h2>
  {% endif %}
</header>

<section id="recent-activity" class="primary" role="main">
  <div class="listing results">
    <div class="results-inner">
      {% if pager.object_list %}
        {% for item in pager.object_list %}
        <div class="item">
          <img class="icon" width="32" height="32" src="{{ addon.get_icon_url(32) if addon else '' }}" alt="">
          <p>
            <span class="action {{ log_action_class(item.action) }}"></span>
            {{ item }}
          </p>
          <p class="timestamp">
          {% trans user=item.user.name,
                   ago=item.created|timesince,
                   iso=item.created|isotime,
                   pretty=item.created|datetime %}
          <time datetime="{{ iso }}" title="{{ pretty }}">{{ ago }}</time>
          by {{ user }}
          {% endtrans %}
          </p>

        </div>
        {% endfor %}
      {% else %}
        <p class="no-results">{{ _('No results found.') }}</p>
      {% endif %}
    </div>
    {% if pager.has_other_pages() %}
      <div class="listing-footer">{{ pager|paginator }}</div>
    {% endif %}
  </div>
</section>

<section class="secondary" role="complementary">
  <div id="refine-results" class="highlight">

    <h3>{{ _('Refine Activity') }}</h3>

    <div id="refine-addon">
      <h5>{{ _('Add-on') }}</h5>

      <ul class="refinements">
        {% for item in addons %}
        {% include 'includes/refinement.html' %}
        {% endfor %}
      </ul>
    </div>

    <div id="refine-activity">
      <h5>{{ _('Activity') }}</h5>

      <ul class="refinements">
        {% for item in activities %}
        {% include 'includes/refinement.html' %}
        {% endfor %}
      </ul>
    </div>

  </div> {# refine-results #}
  <p class="secondary-feed">
    <a href="{{ rss }}" class="subscribe">{{ _('Subscribe to this feed') }}</a>
  </p>
</section>
{% endblock %}
